package validate

import "time"

func SingleFieldValidate() {
	v := validate
	var err error

	var b bool
	err = v.Var(b, "boolean")
	outRes("boolean", &err)

	var num1 = 100
	err = v.Var(num1, "number")
	outRes("number", &err)

	var num2 = 100.10
	err = v.Var(num2, "numeric")
	outRes("numeric", &err)

	var num3 = "100.10"
	err = v.Var(num3, "number")
	outRes("number", &err)

	lise := []int{1, 2, 3}
	err = v.Var(lise, "max=10,min=4")
	outRes("slice", &err)

	mp := map[string]int{}
	mp["A"] = 1
	mp["B"] = 2
	err = v.Var(mp, "max=10,min=3")
	outRes("map", &err)

	timeStr := time.Now().Format("2006-01-02 15:04:05")
	err = v.Var(timeStr, "datetime=2006-01-02 15:04:05")
	outRes("datetime", &err)

	s1 := "ddd"
	s2 := "ddd"
	err = v.VarWithValue(s1, s2, "eqfield")
	outRes("eqfield", &err)

	i1 := 10
	i2 := 12
	err = v.VarWithValue(i1, i2, "ltfield")
	outRes("ltfield", &err)
}
